package com.mowh.multithreading.thread.per.message;

/**
 * @author mowh1gd
 * @create 2023/11/22 14:39
 */
public class Host {
    private final Helper helper = new Helper();
    public void request(final int count, final char c) {
        System.out.println("    request(" + count + ", " + c + ")  BEGIN");
        new Thread() {//重写java.lang.Thread的run方法来显式创建线程，run方法体内是工作内容
            @Override
            public void run() {
                helper.handle(count, c);//工作内容
            }
        }.start();
        System.out.println("    request(" + count + ", " + c + ")  END");
    }
}
